package com.nanhang.controller;

import com.nanhang.entity.Student;
import com.nanhang.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Controller
@RequestMapping("/studenttemp")
public class StudentConrollerTemlate {

	@Autowired
	private StudentService studentService;
	@GetMapping("/list")
	public String list(Model model){
		List<Student> students = studentService.findAll();
		model.addAttribute("students",students);
		return "student/list";
	}
}
